package com.qj.yantaishan.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.qj.yantaishan.mapper.AttachmentMapper;
import com.qj.yantaishan.domain.Attachment;
import com.qj.yantaishan.service.IAttachmentService;
import com.qj.yantaishan.common.core.text.Convert;

/**
 * 附件Service业务层处理
 * 
 * @author qihe
 * @date 2022-07-22
 */
@Service
@Primary
public class AttachmentServiceImpl    extends ServiceImpl<AttachmentMapper, Attachment>  implements IAttachmentService
{
    @Autowired
    private AttachmentMapper attachmentMapper;

    /**
     * 查询附件
     * 
     * @param pigcmsId 附件主键
     * @return 附件
     */
    @Override
    public Attachment selectAttachmentByPigcmsId(Long pigcmsId)
    {
        return attachmentMapper.selectAttachmentByPigcmsId(pigcmsId);
    }

    /**
     * 查询附件列表
     * 
     * @param attachment 附件
     * @return 附件
     */
    @Override
    public List<Attachment> selectAttachmentList(Attachment attachment)
    {
        return attachmentMapper.selectAttachmentList(attachment);
    }

    /**
     * 新增附件
     * 
     * @param attachment 附件
     * @return 结果
     */
    @Override
    public int insertAttachment(Attachment attachment)
    {
        return attachmentMapper.insertAttachment(attachment);
    }

    /**
     * 修改附件
     * 
     * @param attachment 附件
     * @return 结果
     */
    @Override
    public int updateAttachment(Attachment attachment)
    {
        return attachmentMapper.updateAttachment(attachment);
    }

    /**
     * 批量删除附件
     * 
     * @param pigcmsIds 需要删除的附件主键
     * @return 结果
     */
    @Override
    public int deleteAttachmentByPigcmsIds(String pigcmsIds)
    {
        return attachmentMapper.deleteAttachmentByPigcmsIds(Convert.toStrArray(pigcmsIds));
    }

    /**
     * 删除附件信息
     * 
     * @param pigcmsId 附件主键
     * @return 结果
     */
    @Override
    public int deleteAttachmentByPigcmsId(Long pigcmsId)
    {
        return attachmentMapper.deleteAttachmentByPigcmsId(pigcmsId);
    }
}
